package com.cloud.api.limiter;

import org.springframework.cloud.gateway.filter.ratelimit.RedisRateLimiter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author
 * @Description: 限流器配置类
 * @date
 */
@Configuration
public class HostRedisRateLimiter {

    @Bean
    RedisRateLimiter redisRateLimiter() {
        return new RedisRateLimiter(2, 10);
    }

    @Bean
    public HostAddrKeyResolver hostAddrKeyResolver() {
        return new HostAddrKeyResolver();
    }

}
